package com.coders;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.coders.activities.BaseActivity;
import com.coders.activities.MainMenu;
import com.coders.info.Constants;

/**
 * SplashScreen: Called when the activity is first created.
 * 
 * @author Subin
 * 
 */
public class SplashScreen extends BaseActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);

		startSplashAnimation();
	}

	private void startSplashAnimation() {
		Handler handler = new Handler();

		handler.postDelayed(new Runnable() {
			public void run() {
				Intent mainIntent = new Intent(SplashScreen.this,
						MainMenu.class);
				SplashScreen.this.startActivity(mainIntent);

				SplashScreen.this.finish();
				overridePendingTransition(R.anim.fade_in, R.anim.fade_out);

			}
		}, Constants.SPLASH_SCREEN_DISPLAY_DURATION_IN_MILLI_SECONDS);

	}
}